/**
 * Covalent Server Code File
 * 
 * File:        log_helper.c
 * Brief:       BRIEF
 * Author:      Chen Kangbing
 * Email:       ckblau@outlook.com
 * Modified:    2021/10/09 09:35:32
 *
 */


#include "log_helper.h"

#include <stdio.h>
#include <pthread.h>


int log_init(ServerTypeDef *psrv) {
    psrv->log_fh = fopen("./webroot/log/log.txt", "a");
    if (!psrv->log_fh) return -1;
    pthread_mutex_init(&(psrv->log_mut), NULL);
    return 0;
}

void log_deinit(ServerTypeDef *psrv) {
    fclose(psrv->log_fh);
}

